<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="peoit" tagdir="/WEB-INF/tags"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<peoit:include>
	<div class="pd-20">
		<form action="<c:url value="/admin/sms/save"/>" method="post" class="form form-horizontal" id="savesms">
			<c:set value="${viewData }" var="vt"></c:set>
			<input type="hidden" name="id" value="${vt.id }" />
			<div class="row cl">
				<label class="form-label col-3"><span class="c-red">*</span>用户名：</label>
				<div class="formControls col-7">
					<input type="text" class="input-text" placeholder="用户名" name="account" datatype="*" nullmsg="用户名不能为空" value="${vt.account }">
				</div>
			</div>
			<div class="row cl">
				<label class="form-label col-3"><span class="c-red">*</span>密码：</label>
				<div class="formControls col-7">
					<input type="text" class="input-text" placeholder="密码" name="pswd" datatype="*" nullmsg="密码不能为空" value="${vt.pswd }">
				</div>
			</div>
			<div class="row cl">
				<label class="form-label col-3"><span class="c-red">*</span>模板内容：</label>
				<div class="formControls col-7">
					<input type="text" class="input-text" placeholder="模板内容" name="msg" datatype="*" nullmsg="模板内容不能为空" value="${vt.msg }">
				</div>
			</div>
			<div class="row cl">
				<label class="form-label col-3"><span class="c-red">*</span>模板类型：</label>
				<div class="formControls col-7">
					<select name="type" class="select">
						<option value="A" selected="selected">验证码</option>
						<option value="B">通知</option>
					</select>
				</div>
			</div>
			<div class="row cl">
				<label class="form-label col-3"><span class="c-red">*</span>模板状态：</label>
				<div class="formControls col-7">
					<select name="status" class="select">
						<option value="true" ${vt.status?"selected":""}>已激活</option>
						<option value="false" ${vt.status == false?"selected":""}>未激活</option>
					</select>
				</div>
			</div>
			<div class="row cl">
				<label class="form-label col-3"><span class="c-red">*</span>URL：</label>
				<div class="formControls col-7">
					<input type="text" class="input-text" placeholder="URL" name="url" datatype="*" nullmsg="URL不能为空" value="${vt.url }">
				</div>
			</div>
			<div class="row cl">
				<label class="form-label col-3">NEEDSTATUS：</label>
				<div class="formControls col-7">
					<select name="needstatus" class="select">
						<option value="0" ${vt.needstatus?"selected":""}>true</option>
						<option value="1" ${vt.needstatus==false?"selected":""}>false</option>
					</select>
				</div>
			</div>
			<div class="row cl">
				<label class="form-label col-3">PRODUCT：</label>
				<div class="formControls col-7">
					<input class="input-text" type="text" name="product" value="${vt.product }" />
				</div>
			</div>
			<div class="row cl">
				<label class="form-label col-3">EXTNO.：</label>
				<div class="formControls col-7">
					<input class="input-text" type="text" name="extno" value="${vt.extno }" />
				</div>
			</div>
			<div class="row cl">
				<label class="form-label col-3"><span class="c-red">*</span>验证码随机数位数：</label>
				<div class="formControls col-7">
					<input type="text" class="input-text" placeholder="验证码随机数位数" name="length" name="title" datatype="n0-2" errormsg="请输入正确的验证码随机数位数" value="${vt.length }">
				</div>
			</div>
			<div class="row cl">
				<label class="form-label col-3"><span class="c-red">*</span>验证码失效时间(秒)：</label>
				<div class="formControls col-7">
					<input type="text" class="input-text" placeholder="验证码失效时间" name="failureTime" datatype="n0-10" errormsg="请输入正确的时间" value="${vt.failureTime }">
				</div>
			</div>
			<div class="row cl">
				<div class="col-9 col-offset-3">
					<input class="btn btn-primary radius" type="submit" value="&nbsp;&nbsp;保存&nbsp;&nbsp;">
				</div>
			</div>
		</form>
	</div>
</peoit:include>
<script type="text/javascript">
	function refreshAndColse() {
		window.parent.location.href = window.parent.location;
	}
	$(function() {
		//表单验证ajax提交
		$("#savesms").Validform({
			tiptype : 3,
			callback : function(form) {
				$("#savesms").ajaxSubFromDialog(this);
				setTimeout(refreshAndColse, 1500);
				return false;
			}
		});

	});
</script>